<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title><?php echo (C("WEBTITLE")); ?></title><meta name="robots" content="noindex, nofollow"><link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/reset.css"/><link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/css/style.css?v=<?php echo time();?>"/><script type="text/javascript" src="__PUBLIC__/admin/js/jquery-1.7.2.min.js"></script><script type="text/javascript" src="__PUBLIC__/admin/js/common.js"></script><script type="text/javascript">
var ROOT_PATH="__ROOT__",
	APP="__APP__",
	URL="__URL__",
	SELF="__SELF__";
</script></head><link rel="stylesheet" type="text/css" href="__PUBLIC__/admin/editormd/editormd.css?v=1.0"/><script charset="utf-8" src="__PUBLIC__/admin/js/kindeditor-4.1.4/kindeditor-min.js"></script><script charset="utf-8" src="__PUBLIC__/admin/js/kindeditor-4.1.4/lang/zh_CN.js"></script><script type="text/javascript" src="__PUBLIC__/admin/js/engine.js"></script><script type="text/javascript" src="__PUBLIC__/admin/js/jq_validate.js"></script><script type="text/javascript" src="__PUBLIC__/admin/editormd/editormd.js"></script><script type="text/javascript">
$(function(){
	$('#title').validate('required','请填写文章标题').validate('minlength',1,'标题长度1~160个字符').validate('maxlength',160,'标题长度1~160个字符').validate();
	$('#category_id').validate('selectRequired','请选择所属栏目').validate();
	$('#dataForm').submitValidate();	
	KindEditor.ready(function(K) {
	 K.create('textarea[name="content"]', {
                uploadJson :APP+'/Public/uploadByEditor/',
                fileManagerJson :APP+'/Public/fileManagerByEditor/',
                allowFileManager : true
     });
	});


    var testEditor;


    testEditor = editormd("test-editormd", {
        width   : "100%",
        height      : '600px',
        syncScrolling : "single",
        path    : "__PUBLIC__/admin/editormd/lib/",
        imageUpload : true,
        imageFormats : ["jpg", "jpeg", "gif", "png", "bmp", "webp"],
        imageUploadURL : APP+'/Public/uploadByMarkdown/'
    });



});
</script><body class="mainBackground"><script type="text/javascript">
$(function(){
	layout.init();	
});
</script><div class="sidebar"><div class="mt30 f14 bold"><?php echo (C("WEBTITLE")); ?></div><div class="mt10"><?php echo (session('username')); ?>(<?php echo (get_role(session('role'))); ?>)
        </div><div class="mt10"><a href="/" title="网站首页" target="_blank">网站首页</a> |
        	<a href="<?php echo U('Administrator/password');?>" title="修改密码">修改密码</a> |
            <a href="<?php echo U('Public/loginOut');?>" title="安全退出">安全退出</a></div><dl class="sidebar_nav"><dt <?php if((MODULE_NAME) == "Public"): ?>class="current"<?php endif; ?>><a href="<?php echo U('Public/index');?>" title="后台首页">后台首页</a></dt></dl><?php if(is_array($menu)): $i = 0; $__LIST__ = $menu;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><dl class="sidebar_nav"><dt <?php if(($vo[name]) == MODULE_NAME): ?>class="current"<?php endif; ?>><?php echo ($vo["title"]); ?></dt><dd <?php if(($vo[name]) == MODULE_NAME): ?>style="display: block;"<?php endif; ?>><?php if(is_array($vo["sub"])): $i = 0; $__LIST__ = $vo["sub"];if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$v): $mod = ($i % 2 );++$i;?><a href="<?php echo U($vo[name].'/'.$v[name]);?>" title="<?php echo ($v["title"]); ?>"><?php echo ($v["title"]); ?></a><?php endforeach; endif; else: echo "" ;endif; ?></dd></dl><?php endforeach; endif; else: echo "" ;endif; ?></div><div class="main" id="mainContainer"><!--发布--><div class="content_box"><div class="content_box_t"><h3 class="fl"><?php if(($data[id]) != ""): ?>编辑<?php else: ?>发布<?php endif; ?>文章
                </h3></div><div class="content_box_c"><form action="__ACTION__" method="post" id="dataForm" name="dataForm" enctype="multipart/form-data"><div class="field"><label>标题</label><input class="text_input medium_input" type="text" name="title" id="title" value="<?php echo ($data["title"]); ?>" /><span class="input_notification  png_bg" id="titleTip"></span><small>必填</small></div><div class="field pt15"><label>所属栏目</label><select name="category_id" class="public_dropdown small_input" id="category_id"  type="select-one"><option value="0">请选择所属栏目</option><?php echo ($optionStr); ?></select><span class="input_notification  png_bg" id="category_idTip"></span></div><div class="field pt15"><label>缩略图
                        	<?php if(($data['thumb']) != ""): ?>(<a href="/uploadfile/original/<?php echo ($data["thumb"]); ?>" title="查看图片" target="_blank"  style="color:#F00;">查看图片</a>)<?php endif; ?></label><input class="text_input medium_input" type="file" name="photo" id="photo"/><small>(图片格式：jpg,gif,png)</small></div><div class="field pt15"><label>标签</label><input class="text_input long_input" type="text" name="tags"  id="tagsHandle" value="<?php echo ($tags); ?>"/><small>标签以“,”隔开</small></div><div class="field pt15"><label>推荐位</label><?php if(is_array($flagArray)): $i = 0; $__LIST__ = $flagArray;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><input type="radio" name="flag" value="<?php echo ($vo["key"]); ?>" 
                                <?php if(($vo["key"]) == $data[flag]): ?>checked<?php endif; ?>
                                /><?php echo ($vo["title"]); endforeach; endif; else: echo "" ;endif; ?></div><div class="field pt15"><label>模板文件名</label><input class="text_input small_input" type="text" name="tpl" id="tpl" value="<?php echo ($data["tpl"]); ?>" /><small>用于发布插件信息</small></div><div class="field pt15"><label>是否开放</label><input type="checkbox" name="status"  value="1" <?php if(($data["status"]) == "1"): ?>checked<?php endif; ?>/>是 
						<small>默认开放</small></div><div class="field pt15"><label>简介</label><textarea class="text_input" name="brief" id="brief" cols="79" rows="5"><?php echo ($data["brief"]); ?></textarea><small>如果不填写则取详细内容部分填充</small></div><div class="field pt15"><label>详细内容</label><textarea class="text_input" name="content" style="width:99%;height:500px;"><?php echo (htmlspecialchars($data["content"])); ?></textarea></div><div class="field pt15"><label>详细内容</label><div id="test-editormd"><textarea style="display:none;" name="markdown_content"><?php echo ($data["markdown_content"]); ?></textarea></div></div><div class="field pt15"><label>SEO标题</label><input class="text_input medium_input" type="text" name="seo_title" value="<?php echo ($data["seo_title"]); ?>"/><small>自定义标题,一般不超过80个字符</small></div><div class="field pt15"><label>SEO关键词</label><input class="text_input medium_input" type="text" name="seo_keywords" value="<?php echo ($data["seo_keywords"]); ?>"/><small>关键词以","隔开一般不超过100个字符</small></div><div class="field pt15"><label>SEO描述</label><textarea class="text_input" name="seo_description" cols="79" rows="5"><?php echo ($data["seo_description"]); ?></textarea><small>帮助SEO优化,一般不超过200个字符</small></div><div class="field pt15 clearfix"><input type="hidden" name="id" value="<?php echo ($data["id"]); ?>"/><input type="submit" value="提交" class="public_button fr" /></div></form></div></div><!--发布结束--></div></body></html>